Disk drive with cache having volatile and nonvolatile memory

ABSTRACT

A disk drive that includes nonvolatile memory for use when the disk drive is in standby mode also uses the nonvolatile memory, together with a volatile memory, as a cache when the disk drive is in both standby and non-standby mode. Each of the data blocks stored on the disks is also stored in a cache line of either the volatile memory or the nonvolatile memory. Each cache line in both the volatile and nonvolatile memory stores one or more data blocks and an associated tag. The tag contains at least a portion of the logical block address that corresponds to the data block that is stored in the cache line. The volatile memory also has locations allocated to store tags that “shadow” the tags in the nonvolatile memory. By searching the shadow tags in the faster volatile memory, it can be determined if a data block is in the nonvolatile memory without searching the slower nonvolatile memory.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates generally to disk drives, and more particularlyto a magnetic recording disk drive having a cache that includesnonvolatile memory.

2. Description of the Related Art

Magnetic recording hard disk drives (HDDs) typically include, inaddition to the rotating disk storage, solid state memory (referred toas “cache”) that temporarily holds data before it is transferred betweenthe host computer and the disk storage. The conventional cache isdynamic random access memory (DRAM), a volatile form of memory that canundergo a significant number of write/erase cycles and that has a highdata transfer rate.

The disk drive's data controller receives the write data from the hostand controls the writing to the disks and the DRAM. The transfer of thewrite data to the DRAM is typically done using one of two conventionalmethods. In a first method, called “write-back caching”, the block ofwrite data for a write command from the host is stored in DRAM, andwrite completion is signaled to the host when the block of write datahas been received in the DRAM. The block of write data in DRAM is thenlater destaged from the DRAM and written to the disks. In a secondmethod, sometimes called “write-through caching”, every write to DRAMalso causes a write to the disks and write completion is signaled to thehost only after the block of write data has been written to the disks.

With the advent of mobile computers that are battery powered, some HDDshave a “power-save” or “standby” mode wherein the disks spin down (stoprotating) when the drive has been inactive for a period of time. Themain purpose of this mode is to extend the battery life of the mobilecomputer. When a disk drive is in standby mode, with just theelectronics active, battery power is conserved. When write data isreceived from the host and must be written to the disks, the drive exitsstandby mode and the disks spin up to enable the write data to bewritten, which consumes a significant amount of battery power. If thisoccurs too frequently, there is no power saving.

One solution to this problem is to store the write data in the DRAM whenthe drive is in standby mode and the disks are not rotating, and thendestage the write data to the disks at some later time, as inwrite-cache enabled. However, because DRAM is volatile memory, there isa risk that the write data in the DRAM can be lost if the drive losespower before the write data can be destaged to the disks. Thus it hasbeen proposed to use nonvolatile memory, e.g., “flash” memory, inaddition to or in place of DRAM in HDDs used in mobile computers, duringthe standby mode. The primary advantage is the ability to receive writedata from the host without having to exit the standby mode, therebyconserving power and extending battery life, but without any risk oflosing data in the event of a power failure.

The advantage of volatile memory like DRAM for caching is its speed, butit is relatively expensive and has high power consumption. As aconsequence of the cost and power requirement, caches are usuallyrelatively small. And as a consequence of the volatility, after a resumeoperation, the cache is empty and will generate a lot of cache missesbefore being fully operative. Also, at power-down, the cache must beflushed to ensure data integrity.

The access time (i.e., the time to read or write data) for nonvolatilememory, like flash memory, is considerably longer than the access timefor DRAM. Also, flash memory, unlike DRAM, has a limited number ofwrite/erase cycles before it is no longer usable. However, despite thesedisadvantages, flash memory is less expensive and uses less power thanDRAM.

Thus in a HDD in which the nonvolatile memory is used for caching instandby mode, it would be desirable to also optimize the use of thenonvolatile memory together with the volatile memory for caching duringnormal non-standby operation as well as during standby operation of theHDD.

SUMMARY OF THE INVENTION

The invention is a disk drive with a cache that includes both volatileand nonvolatile memory, with the nonvolatile memory also functioning ascache when the disk drive is not in standby mode. Each of the datablocks stored on the disks is associated with a logical block address(LBA), which identifies the physical sectors where the data block isstored. Each of the data blocks stored on the disks is also stored in acache line of either the volatile memory or the nonvolatile memory. Eachcache line in both the volatile and nonvolatile memory stores one ormore data blocks and an associated tag. The tag contains a portion ofthe LBA that corresponds to the data block or blocks that are stored inthe cache line. The volatile memory also has locations allocated tostore tags that “shadow” the tags in the nonvolatile memory. Each time adata block and its tag are written to a cache line in nonvolatilememory, the tag, but not the data block, is also written to a locationin volatile memory. Thus every tag in nonvolatile memory is shadowed involatile memory. By searching the shadow tags in the faster volatilememory, it can be determined if a data block is in the nonvolatilememory without searching the slower nonvolatile memory.

Each shadow tag in the volatile memory may also have associated with itone or more count fields, e.g., a cache line write (CLW) count field andan access (read and/or write) count field. The CLW count field isincremented each time there is a write to the associated cache line innonvolatile memory. The CLW count field enables “wear-leveling” of thecache lines in the nonvolatile memory. The objective of wear-leveling isto equally distribute the number of cache line writes across allnonvolatile memory cache lines, to thereby maximize the life of thenonvolatile memory. Thus a “wear-leveled” nonvolatile memory wouldresult in all the CLW count fields having generally the same value. Theaccess count field enables a frequently-accessed data block in theslower nonvolatile memory to be upgraded to the faster volatile memory,for example when the access count field for a data block exceeds apredetermined value.

The volatile memory may also include a write buffer. Data blocks thatare to be written to the nonvolatile memory are written to the writebuffer and then transferred from the write buffer to the nonvolatilememory in the background, i.e., when the disk drive is idle, i.e., notreading or writing to the disks, or the controller is not performingother operations.

For a fuller understanding of the nature and advantages of the presentinvention, reference should be made to the following detaileddescription taken together with the accompanying figures.

BRIEF DESCRIPTION OF THE DRAWING

FIG. 1 is a block diagram of a magnetic recording hard disk drive (HDD)according to this invention.

FIG. 2 is a schematic illustrating the data layout and structure amongthe disks, and the volatile memory and nonvolatile memory making up thecache, in a HDD.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1 is a block diagram of a magnetic recording disk drive (HDD) 10according to this invention. The HDD 10 includes a hard disk controller(HDC) 12 that can include and/or be implemented by a microcontroller ormicroprocessor. The controller 12 runs a computer program that is storedin memory 14 and that embodies the logic and algorithms describedfurther below. The memory 14 may be separate from controller 12 or asembedded memory on the controller chip. The computer program may also beimplemented in microcode or other type of memory accessible to thecontroller 12.

The controller 12 is connected to a host interface 16 that communicateswith the host computer 18. The host computer 18 may be a portablecomputer that can operate from battery power. The host interface 16 maybe any conventional computer-HDD interface, such as Serial ATA (AdvancedTechnology Attachment) or SCSI (Small Computer System Interface).

The controller 12 is also connected to each of the HDD's read/writeheads 22 through the read/write channel 20. The heads 22 move across thesurfaces of the magnetic recording disks 24 to access concentric datatracks. The HDD 10 typically includes a stack of disks 24 that aremounted on and rotated by a spindle motor 26, with each disk surfacebeing associated with one of the heads 22. Each of the concentric datatracks in an HDD is divided into contiguous physical sectors where thedata is stored, with each physical sector being associated with alogical block address (LBA). An actuator 28 moves the heads 22 acrossthe concentric data tracks on the disk surfaces so the heads 22 canaccess the desired physical sectors where the data is to be read orwritten.

The controller 12 acts as a data controller to transfer blocks of writedata from the host computer 18 through the read/write channel 20 forwriting to the disks 24 by the heads 22, and to transfer blocks of readdata from the disks 24 back to the host computer 18. The controller 12also communicates with volatile memory 30 and nonvolatile memory 32 viadata bus 34. One type of volatile memory 30 may be dynamic random accessmemory (DRAM). One type of nonvolatile memory 32 may be flash memory.Flash memory stores information in an array of floating gatetransistors, called “cells”, and can be electrically erased andreprogrammed in blocks.

In a HDD the speed at which data can be written to the disks isdetermined by a number of physical constraints. For example, if the headto do the writing is positioned over one area of its associated disk anda block of data is to be written at another area of the disk, there is a“seek time” delay for the head to be moved between the concentric datatracks. Also, there is a “rotational latency” delay required for thedisk to rotate to the proper position relative to the head so the headcan access the proper physical sector. Thus, the host computer must waitfor the disk drive to complete the write operation. To reduce thiswaiting time the block of write data from the host computer 18 is firstwritten into cache, i.e., the volatile memory 30 (typically DRAM). Thelocations or addresses in the cache where the cached data blocks arestored are also called “cache lines”. A block of data stored in a cacheline also has a “tag” associated with it that contains the LBA where theblock of data is also to be stored on the disks. Typically multipleblocks of data are stored in a single cache line. After the block ofwrite data has been written to the cache, the host computer can continuewith operations without waiting until the write operation is complete.The block of write data is later removed or destaged from the cache andwritten to the disk. The controller 12 typically applies one of severalwell-known scheduling algorithms, based upon factors including seektime, rotational latency, and the size of the write cache, to determinewhich blocks of write data are removed from cache and the time at whichthe blocks are written to the disks.

When the HDD 10 is in “power-save” or “standby” mode with the disks notrotating, caching also takes place but the controller 12 directs thewrite data from the host computer 18 to the nonvolatile memory 32. Writedata that is already stored in the volatile memory 30 when standby modeis initiated may also be transferred to the nonvolatile memory 32. Thisassures that the write data will not be lost if there is a loss of powerto the HDD 10 during the power-save mode. This mode of operation allowsthe HDD 10 to receive write data from the host computer 18 withouthaving to spin the disks back up, thereby conserving power and extendingbattery life, but without any risk of losing data in the event of apower failure.

In this invention, the cache includes both the volatile memory 30 andthe nonvolatile memory 32, with the nonvolatile memory 32 alsofunctioning as cache when the disk drive is not in standby mode. Thevolatile memory 30 is faster and possibly smaller than the larger andslower nonvolatile memory 32. FIG. 2 is a schematic illustrating thedata layout and structure among the cache (volatile memory 30 and thenonvolatile memory 32) and the disks 24. Each of the data blocks storedon the disks is associated with a LBA, which identifies the physicalsectors where the data block is stored. Some of the data blocks storedon the disks are also stored in either the volatile memory 30 or thenonvolatile memory 32 of the cache. Each cache line in both the volatilememory 30 and nonvolatile memory 32 has an address and stores one ormore data blocks and an associated tag. The tag contains a portion ofthe LBA that corresponds to the first data block that is stored in thecache line. As shown by an example in FIG. 2, data blocks for LBAs 130,275 and 432 match data blocks in cache lines with tags 130, 275 and 432,respectively, in volatile memory 30; and data blocks for LBAs 658, 841and 903 match data blocks in cache lines with tags 658, 841 and 903,respectively, in nonvolatile memory 32. The example in FIG. 2 is asimplified schematic for ease of explanation and shows only a singledata block stored in each cache line. In actuality each cache line wouldtypically contain multiple data blocks corresponding to the data blocksstored in multiple adjacent sectors on the disks. Thus in this typicalcase the tag would need to be only a portion of the LBA of the firstdata block because the data blocks corresponding to the adjacent datasectors would share the most significant bits of the LBA of the firstdata block. Thus each tag contains at least a portion of an LBA, or theentire LBA if only a single data block is stored in the associated cacheline.

The volatile memory 30 also has locations allocated to store tags that“shadow” the tags in the nonvolatile memory 32. Each time a data blockand its tag are written to a cache line in nonvolatile memory 32 thetag, but not the data block, is also written in volatile memory 30. Thusevery tag in nonvolatile memory 32 is shadowed in volatile memory 30.The use of shadow tags enables the controller 12 to determine if data isin the nonvolatile memory 32 of the cache by accessing the fastervolatile memory 30, rather than the slower nonvolatile memory 32. Eachshadow tag may also have associated with it a cache line write (CLW)count field and an access count field. The CLW count is incremented eachtime there is a write to the associated cache line in nonvolatile memory32. The use of the CLW count field enables controller 12 to level the“wear” of the nonvolatile memory cache lines, for example by selecting acache line with a lower CLW count value if the previously selected cacheline has a count value that exceeds a predetermined threshold value. TheCLW count fields are also stored in nonvolatile memory 32, because thesevalues need to be recovered at disk drive start-up. The access countfields in the volatile memory 30 are used to track the number ofaccesses to the data blocks to enable “upgrading” frequently-accesseddata from nonvolatile memory 32 to the faster volatile memory 30. Asused herein “access” may mean “read from”, “written to”, or both “readfrom” and “written to”.

The volatile memory 30 also includes a portion allocated for a writebuffer 35. Data blocks that are to be written to the nonvolatile memory32 are written to the write buffer 35. The data blocks are thentransferred from the write buffer 35 to the nonvolatile memory 32 in thebackground, i.e., when the controller 12 is idle, so there is noperformance hit.

The operation of the HDD with the cache according to this invention willnow be explained for the read and write possibilities: a read cache hit,a read cache miss, a write cache hit and a write cache miss.

When the controller 12 receives a read command from host computer 18 toretrieve a data block, it looks first to cache. The controller 12searches the volatile memory 30 by comparing the LBA for the readcommand to all tags and shadow tags in the volatile memory 30. If thecontroller 12 finds that the tag or shadow tag is in the volatile memory30 a read cache “hit” has occurred. If it is a tag that is in volatilememory 30 then the data block for the tag is also in volatile memory 30and it is immediately read and returned to the host computer 18.However, if it is a shadow tag that is in volatile memory then the datablock for the shadow tag is in nonvolatile memory 32. The controller 12then reads the associated cache line from nonvolatile memory 32 andreturns the data block to host computer 18. The controller 12 alsoincrements the access count field associated with that shadow tag tokeep track of the number of accesses to that data block.

If the controller 12 does not find either the tag or the shadow tag forthe LBA in the volatile memory 30, then a read cache “miss” hasoccurred, and the requested data block must be read from the disks 24.The controller 12 then reads the data block associated with the LBA fromthe disks 24 and returns it to the host computer 18. If a copy of thedata block is to be saved in the cache, then the controller 12 may writethe data block to either volatile memory 30 or nonvolatile memory 32. Ifit is written to volatile memory 30, there is no performance hit.However, if all cache lines in volatile memory 30 are full, then a datablock from an existing cache line must be evicted. The controller 12will implement a replacement policy to determine which cache line toevict. There are a variety of known replacement policies, such as “LRU”which replaces the least recently used data blocks. Instead of evictingan existing data block, the controller 12 may move it to nonvolatilememory 32. Since this is a relatively time-consuming operation, the datablock is saved in the write-buffer 35, and a background write is startedto move it to a cache line in nonvolatile memory 32. If an existing datablock in volatile memory 30 is moved to nonvolatile memory 32 then thecontroller 12 writes it to the write buffer 35, writes the tag and datablock to a cache line in nonvolatile memory 32 in background, writes theshadow tag to a location in volatile memory 30, and increments the CLWcount field in both volatile memory 30 and nonvolatile memory 32.

If after the read cache miss the copy of the data block read from thedisks 24 is to be written in nonvolatile memory 32 instead of volatilememory 30, then the controller 12 writes it to the write buffer 35,writes the tag and data block to a cache line in nonvolatile memory 32in background, writes the shadow tag to a location in volatile memory30, and increments the CLW count field in both volatile memory 30 andnonvolatile memory 32.

The decision to write the data block to either volatile memory 30 ornonvolatile memory 32 is determined by an algorithm, implemented as acomputer program or set of instructions executed by the controller 12.In a first example, each new data block to be written is written tovolatile memory 30, but if volatile memory 30 is full it is written tononvolatile memory 32. In a second example, each new data block to bewritten is written to volatile memory 30, but if volatile memory 30 isfull a cache line is evicted and the data block in that cache line ismoved to nonvolatile memory 32. In a third example, the LBA for each newdata block to be written is checked against a range of LBAs for “hot” orfrequently-accessed data. If the LBA is within the range that data blockis written to the volatile memory 30, which provides faster access, andif it is not within that range it is written to nonvolatile memory 32.

When the controller 12 receives a write command from host computer 18,it looks first to cache. The controller 12 compares the LBA for thewrite command to all tags and shadow tags in the volatile memory 30. Ifthe controller 12 finds that the tag or shadow tag is in the volatilememory 30 a write cache “hit” has occurred, and the cache lineassociated with the tag or shadow tag must be updated with the new datablock. The cache line is also marked as “dirty” if “write-back” cachingis implemented. If it is a tag that is found, then the data block forthat tag is also in volatile memory 30 and the cache line is immediatelyupdated with the new data block. However, if it is a shadow tag that isfound, the data block for the shadow tag is in nonvolatile memory 32.The controller 12 then writes the new data block to the write buffer 35for background writing to the cache line in the nonvolatile memory 32.The controller 12 also increments the CLW count field in both volatilememory 30 and nonvolatile memory 32 to keep track of the number ofwrites to the associated cache line in nonvolatile memory 32.

If the controller 12 does not find either the tag or the shadow tag forthe LBA in the volatile memory 30, then a write cache “miss” hasoccurred, and the new data block must be written to cache. This is likethe above-described process for writing a copy of a data block after aread cache miss. The controller 12 may write the data block to eithervolatile memory 30 or nonvolatile memory 32. If it is written to thevolatile memory 30 there is no performance hit, but if all cache linesin volatile memory 30 are full, then an existing cache line must beevicted or the controller 12 may move an existing data block existing tononvolatile memory 32. Since this is a relatively time-consumingoperation, the data block to be moved is saved in the write-buffer 35,and a background write is started to move it to a cache line innonvolatile memory 32. If an existing data block in volatile memory 30is moved to nonvolatile memory 32 the controller writes a shadow tag forthat data block in volatile memory 30 and also increments the CLW countfield in both volatile memory 30 and nonvolatile memory 32.

If after the write cache miss the data block is to be written innonvolatile memory 32 instead of volatile memory 30, then the controller12 writes it to the write buffer 35, writes the tag and data block to acache line in nonvolatile memory 32 in background, writes the shadow tagto a location in volatile memory 30 and also increments the CLW countfield in both volatile memory 30 and nonvolatile memory 32.

The algorithms described above for determining whether to write tovolatile memory 30 or nonvolatile memory 32 when there is a read cachemiss may also apply to when there is a write cache miss. In anotherexample, in the case of a write cache miss, the controller 12 may sortall of the write commands by LBA and select the blocks of write data foroutlying LBAs (those that would required the longest seek time) as thoseto be written to nonvolatile memory 32. This algorithm is advantageousfor write-through caching because the write data can be written to theslower nonvolatile memory 32 during the time it takes to seek and writeto the disks.

The CLW count fields associated with the shadow tags in volatile memory30 enable the controller 12 to run a “wear-leveling” algorithm,implemented as a computer program or set of instructions executed by thecontroller 12. The objective of wear-leveling is to equally distributethe number of cache line writes across all nonvolatile memory cachelines to thereby maximize the life of the nonvolatile memory 32. Thus asuccessful wear-leveling would result in the controller 12 maintainingall the CLW count fields to have generally the same value. The algorithmmay be run in the background on a periodic basis. In one example, thecontroller 12 will evict the cache line at the address with the lowestvalue in its CLW count field. For example, referring to FIG. 2, the CLWcount field at volatile memory 30 address 17102 has the lowest value of150, so the data block “jkl” in the cache line at address 1201 innonvolatile memory 32 will be evicted. Then the next data block to bewritten to nonvolatile memory 32 will be written in the cache line atthat address, i.e. address 1201 in this example. This assures that thecache lines with the lowest values in their CLW count fields (theleast-recently-used addresses) are written to first.

The access count fields associated with the shadow tags in volatilememory 30 also enable the controller 12 to run an “upgrade/downgrade”algorithm, implemented as a computer program or set of instructionsexecuted by the controller 12. If the access count for a shadow tagreaches a threshold value, indicating frequent accesses to theassociated data block in nonvolatile memory 32, that data block can be“upgraded” to volatile memory 30, where the access is much faster. Thisavoids a performance penalty for frequent accesses to the slowernonvolatile memory 32. If the volatile memory 30 is full at upgrade of adata block, a cache line can be evicted or a data block “downgraded” tononvolatile memory 32.

In this invention, because the nonvolatile memory 32 is used as cacherather than addressable memory, the cache lines are locationindependent. Thus an optional bad block marker can be added to the tag,either as a separate bit, or a bit appended to the tag. When thecontroller 12 writes to a cache line in nonvolatile memory 32 itreceives a status response, indicating that the write is eithersuccessful or unsuccessful. If unsuccessful, the controller 12 changesthe bad block bit to indicate that cache line as bad. Thus for allfuture writes, that cache line is skipped.

While the present invention has been particularly shown and describedwith reference to the preferred embodiments, it will be understood bythose skilled in the art that various changes in form and detail may bemade without departing from the spirit and scope of the invention.Accordingly, the disclosed invention is to be considered merely asillustrative and limited in scope only as specified in the appendedclaims.

1. A disk drive comprising: a rotatable recording disk for the storageof user data from a host computer; a controller for writing user data toand reading user data from the disk; and a cache connected to thecontroller for temporary storage of user data, the cache comprisingvolatile memory and nonvolatile memory; wherein the controller includeslogic for executing method acts comprising: in response to a requestfrom the host computer, searching the volatile memory to determine ifthe requested user data is stored in the nonvolatile memory.
 2. The diskdrive of claim 1 wherein the disk has a plurality of concentric datatracks, each data track including a plurality of contiguous sectors forthe storage of user data, each sector having an associated logical blockaddress (LBA); wherein the nonvolatile memory includes a plurality ofcache lines for the storage of user data and associated tags, each tagidentifying at least a portion of an LBA; wherein the volatile memoryincludes locations for the storage of shadow tags, each shadow tagcorresponding to an associated tag in nonvolatile memory; and whereinthe act of searching the volatile memory comprises searching the shadowtags.
 3. The disk drive of claim 2 wherein the controller includes logicfor executing method acts further comprising: when writing user data andits associated tag to a nonvolatile memory cache line, writing theassociated shadow tag to a location in volatile memory.
 4. The diskdrive of claim 2 wherein the controller includes logic for executingmethod acts further comprising: writing new user data to an availablecache line in volatile memory; prior to said writing new user data,determining if there is an available cache line in volatile memory andif there is not then evicting user data from a cache line to make acache line available.
 5. The disk drive of claim 2 wherein thecontroller includes logic for executing method acts further comprising:writing new user data to an available cache line in volatile memory;prior to said writing new user data, determining if there is anavailable cache line in volatile memory and if there is not thentransferring user data from a cache line in volatile memory to a cacheline in nonvolatile memory to make a cache line available in volatilememory.
 6. The disk drive of claim 5 wherein the volatile memoryincludes a write buffer and wherein transferring user data to a cacheline in volatile memory comprises writing the user data to the writebuffer and thereafter writing the user data in the write buffer to acache line in nonvolatile memory when the controller is idle.
 7. Thedisk drive of claim 1 wherein the nonvolatile memory includes aplurality of cache lines for the storage of user data, wherein thevolatile memory includes a plurality of cache lines for the storage ofuser data, and wherein the controller includes logic for executingmethod acts further comprising: transferring user data from anonvolatile memory cache line accessed more than a predetermined numberof times to a volatile memory cache line.
 8. The disk drive of claim 7wherein the volatile memory includes an access count field associatedwith user data stored in nonvolatile memory, and wherein the controllerincludes logic for executing method acts further comprising: prior totransferring user data from a nonvolatile memory cache line, determiningif the access count field associated with the user data is greater thana predetermined value.
 9. The disk drive of claim 1 wherein thenonvolatile memory includes a plurality of cache lines for the storageof user data, wherein the volatile memory includes a plurality of cachelines for the storage of user data and a cache line write (CLW) countfield associated with each nonvolatile memory cache line forrepresenting the number of times the associated nonvolatile memory cacheline has been accessed, and wherein the controller includes logic forexecuting method acts further comprising: maintaining the CLW countfields to have generally the same value.
 10. The disk drive of claim 9wherein the act of maintaining the CLW count fields to have generallythe same value comprises the acts of: when writing new user data tononvolatile memory, first evicting the user data from a cache linehaving the smallest CLW count field value; and thereafter writing thenew user data to said cache line having the smallest CLW count fieldvalue.
 11. A magnetic recording disk drive comprising: a rotatablemagnetic recording disk for the storage of blocks of data from a hostcomputer, the disk having a plurality of concentric data tracks, eachdata track including a plurality of contiguous sectors for the storageof data blocks, each sector having an associated logical block address(LBA); a read/write head movable across the surface of the disk forwriting data blocks to the sectors and reading data blocks from thesectors; a controller adapted for connection to the host computer fortransferring data blocks between the host computer and the sectors onthe disk in response to read and write commands from the host computer;and a cache connected to the controller and comprising (a) nonvolatilememory having a plurality of cache lines for the storage of data blocksand associated tags, each tag identifying at least a portion of an LBA;and (b) volatile memory having a plurality of cache lines for thestorage of data blocks and associated tags, each tag identifying an atleast a portion of an LBA, and a plurality of locations for the storageof shadow tags, each shadow tag corresponding to an associated tag innonvolatile memory.
 12. The disk drive of claim 11 wherein thecontroller includes logic for executing method acts comprising: inresponse to a read command, searching the shadow tag locations involatile memory to determine if the requested data block is stored innonvolatile memory.
 13. The disk drive of claim 11 wherein thecontroller includes logic for executing method acts comprising:searching the shadow tag locations in volatile memory prior to writing adata block to a cache line in nonvolatile memory.
 14. The disk drive ofclaim 11 wherein the controller includes logic for executing method actscomprising: writing a new data block to an available cache line involatile memory; prior to said writing a new data block, determining ifthere is an available cache line in volatile memory and if there is notthen evicting a data block from a cache line to make a cache lineavailable.
 15. The disk drive of claim 11 wherein the controllerincludes logic for executing method acts comprising: writing a new datablock to an available cache line in volatile memory; prior to saidwriting a new data block, determining if there is an available cacheline in volatile memory and if there is not then transferring a datablock from a cache line in volatile memory to a cache line innonvolatile memory to make a cache line available in volatile memory.16. The disk drive of claim 15 wherein the volatile memory includes awrite buffer and wherein transferring a data block from a cache line involatile memory comprises writing the data block to the write buffer andthereafter writing the data block in the write buffer to a cache line innonvolatile memory when the controller is idle.
 17. The disk drive ofclaim 11 wherein the volatile memory includes an access count fieldassociated with data stored in nonvolatile memory, and wherein thecontroller includes logic for executing method acts further comprising:transferring data from nonvolatile memory to volatile memory if theaccess count field associated with the data is greater than apredetermined value.
 18. The disk drive of claim 11 wherein the volatilememory includes a cache line write (CLW) count field associated witheach nonvolatile memory cache line for storing a CLW count valuerepresenting the number of times the associated nonvolatile memory cacheline has been written to.
 19. The disk drive of claim 18 wherein thecontroller includes logic for executing method acts comprising:transferring a data block from a nonvolatile memory cache line to avolatile memory cache line if the CLW count value for the associatednonvolatile memory cache line is greater than a predetermined value. 20.The disk drive of claim 18 wherein the controller includes logic forexecuting method acts comprising: maintaining the CLW count fields tohave generally the same value.
 21. The disk drive of claim 20 whereinthe act of maintaining the CLW count fields to have generally the samevalue comprises the acts of: when writing a new data block tononvolatile memory, first evicting the data block from a cache linehaving the smallest CLW count value; and thereafter writing the new datablock to said cache line having the smallest CLW count value.